<template>
  <!--<div>-->
    <!--用户名：<input type="text" value="" v-model="sysUser.loginId">-->
    <!--密码：<input type="password" value="" v-model="sysUser.loginPassword">-->
    <!--<input type="button" value="登陆" @click="login()">-->
  <!--</div>-->
  <div class="loginMain" @keyup.enter="login">
    <vue-particles
      color="#ffffff"
      :particleOpacity="0.5"
      :particlesNumber="100"
      shapeType="circle"
      :particleSize="5"
      linesColor="#ffffff"
      :linesWidth="1"
      :lineLinked="true"
      :lineOpacity="0.4"
      :linesDistance="150"
      :moveSpeed="6"
      :hoverEffect="true"
      hoverMode="grab"
      :clickEffect="true"
      clickMode="push"
    >
    </vue-particles>
    <div class="logo">
      <img :src="logo">
    </div>
    <div class="loginpanel">
      <div class="intropanel">
        <h2 class="cntitle"><p>智</p><p>能</p><p>监</p><p>控</p><p>系</p><p>统</p></h2>
        <h2 class="entitle"><p>Intelligent</p><p>monitoring</p><p>system</p></h2>
      </div>
      <div class="formpanle">
        <div class="title">
          账号密码登录
        </div>
        <div class="inputarea">
          <el-row>
            <p>账号</p>
            <el-input v-model="sysUser.loginId" placeholder="请输入账号"></el-input>
          </el-row>
          <el-row>
            <p>密码</p>
            <el-input v-model="sysUser.loginPassword" type="password" placeholder="请输入密码"></el-input>
          </el-row>
          <el-row class="btnrow">
            <el-button type="primary" @click="login()">登录</el-button>
          </el-row>
        </div>
      </div>
    </div>
    <div class="facelogin">
      <a href="javascript:;">
        <img :src="facelogin">
        <p>人脸登录</p>
      </a>
    </div>
  </div>
</template>
<script>
  export default {
    data () {
      return {
        sysUser: {
          loginId: '',
          loginPassword: ''
        },
        logo: require('../assets/img/hclogo.png'),
        facelogin: require('../assets/img/login/facelogin.png')
      }
    },
    methods: {
      login() {
        this.axios.post(this.FSA + '/sysuser/login', {
            loginId: this.sysUser.loginId.toString(),
            loginPassword: this.sysUser.loginPassword
        }).then(res => {
          console.log(res)
          if (res.data.code === 0) {
            this.$router.push('/livemonitor')
          } else {
            alert(res.data.msg)
          }
        }).catch(function (error) {
          console.log(error)
        })
      }
    }
  }
</script>
